package it.patterns.structural.flyweight;

public class ConcreteFlyweight implements Flyweight {
	private String intrinsic;

	public ConcreteFlyweight(String intrinsic) {
		super();
		this.intrinsic = intrinsic;
	}

	@Override
	public String operation(String extrinsicState) {
		return "Extrinsic: " + extrinsicState + " Intrinsic: " + intrinsic;
	}

	@Override
	public boolean isEqualsTo(Flyweight flyweight) {
		return intrinsic.equals(flyweight.getIntrinsic());
	}

	@Override
	public String getIntrinsic() {
		return intrinsic;
	}

}
